# k8s/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ${rootArtifactId}
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: ${rootArtifactId}
  template:
    metadata:
      labels:
        app: ${rootArtifactId}
    spec:
      containers:
        - name: ${rootArtifactId}
          image: smartdo-registry-cn.tuya-inc.com:7799/${tenant_code}/dev/${rootArtifactId}
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 1035
              protocol: TCP
            - name: dubbo
              hostPort: ${dubbo_port}
              containerPort: ${dubbo_port}
              protocol: TCP
          envFrom:
            - secretRef:
                name: smartdo-mysql-rw
            - secretRef:
                name: smartdo-redis
            - secretRef:
                name: smartdo-zookeeper
            - secretRef:
                name: smartdo-apollo
            - secretRef:
                name: smartdo-tenant-config
          env:
          - name: DUBBO_PORT_TO_BIND
            value: '${dubbo_port}'
          - name: DUBBO_PORT_TO_REGISTRY
            value: '${dubbo_port}'
          - name: server.port
            value: '1035'
          - name: DUBBO_IP_TO_REGISTRY
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: status.hostIP
      imagePullSecrets:
        - name: smartdo-harbor
      hostNetwork: false
